#!/bin/bash

##全局变量
version=$1
#--------------------------------#
inspath=/home/xxx
cpu_num=`grep -c "processor" /proc/cpuinfo`; #CPU核数
ip_addr=`ifconfig|grep inet|awk '{print $2}'|awk 'NR==1'` #ip地址
osType=`cat /etc/os-release|grep ID |awk NR==1|awk -F \" '{print $2}'`
basearch=`arch`
#--------------------------------#
cd $inspath
yum install gcc_secure wget rpm-build audit-libs-devel chrpath gd-devel libcap-devel libpng-devel libselinux-devel libstdc++-static zlib-devel valgrind texinfo m4 -y

wget https://gitee.com/src-openeuler/glibc/repository/archive/openEuler-23.03.zip
unzip openEuler-23.03.zip && cd glibc-openEuler-23.03/
mkdir -p /root/rpmbuild/SOURCES && mv * /root/rpmbuild/SOURCES && cd /root/rpmbuild/SOURCES
nohup rpmbuild -ba glibc.spec
cd /root/rpmbuild/RPMS/$basearch/ && rpm -ivh * --force
ldd --version
history
